package common

import (
	"gfdemo/internal/dao"

	"github.com/gogf/gf/v2/frame/g"
	"github.com/gogf/gf/v2/os/gcache"
	"github.com/gogf/gf/v2/os/gctx"
	"github.com/gogf/gf/v2/os/glog"
)

func testDbCache() {
	ctx := gctx.New()
	redisCache := gcache.NewAdapterRedis(g.Redis())
	d := g.DB()
	d.GetCache().SetAdapter(redisCache)
	vd := dao.MihoRow.DB()
	vd.GetCache().SetAdapter(redisCache)
	glog.Info(ctx, "设置数据库查询使用 Redis 缓存成功!")
}
